set global.ToolOnSelected = 0
if !move.axes[0].homed || !move.axes[1].homed
    M98 P"homey.g" Z15 D1 U0                                         ; 归位Y轴(下沉平台15mm, 不上升)
    M98 P"homex.g" Z15 D0 U0                                         ; 归位X轴(不下沉）, 不上升)
while iterations < 4
    if global.ToolOnSelected = 0
        M98 P"0:/sys/ToolDetect/ToolUnload.g"  T{iterations}
